package demo529;

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class TestMap {
    public static void main(String[] args) {
        Map<String,String> map = new HashMap();
        map.put("1","张三");
        map.put("2","王五");
        map.put("3","赵六");
        System.out.println(map.get("1"));
        Scanner sc = new Scanner(System.in);
        for (String key : map.keySet()){
            if (map.get(key).equals(sc.next())){
                System.out.println(map.get(key));
            };
        }
        map.put("1","张三");
        map.put("2","王五");
        map.put("3","赵六");
        System.out.println(map);
    }
}
